import { getStoreTypeList } from "./../modules/login";
// 请求响应参数（不包含data）
export interface Result {
  code: string;
  msg: string;
}

export interface ResDetail<T> {
  code: string;
  msg: string;
  count: number;
  otherData: any;
  rowId: any;
  data: T;
}

// 请求响应参数（包含data）
export interface ResultData<T = any> extends Result {
  data: T;
}

// 分页响应参数
export interface ResPage<T> {
  map(arg0: (item: { key: any; code: any; value: any; name: any }) => { value: any; label: any }): unknown;
  list: T[];
  pageNum: number;
  pageSize: number;
  total: number;
}

// 分页请求参数
export interface ReqPage {
  pageNum: number;
  pageSize: number;
}

// 文件上传模块
export namespace Upload {
  export interface ResFileUrl {
    fileUrl: string;
  }
}

// 登录模块
export namespace Login {
  export interface ReqLoginForm {
    username: string;
    password: string;
    clientType: number;
    verificationKey: string;
  }
  export interface ReqLoginFormCode {
    phone: string;
    code: string;
    pty: string;
    clientType: number;
  }
  export interface ResLogin {
    token: any;
    sysUser: any;
    store: any;
  }
  export interface ResAuthButtons {
    [key: string]: string[];
  }
  export interface StoreTypeList {
    children: StoreTypeList[];
    id: number;
    name: string;
    parentId: number;
    sort: number;
  }
}

// 商品管理模块
export namespace Product {
  export interface ResProductList {
    id: string;
    name: string;
    image: string;
    sn: string;
    price: string;
    unit: string;
    spesDesc: string;
    stock: number;
    isMarketable: boolean;
    goodsCategoryId: string;
    updateTime: string;
  }
  export interface ResBrandList {
    id: string;
    logoImageUrl: string;
    name: string;
    isShow: boolean;
    createTime: string;
  }
  export interface ResCategoryList {
    id: string;
    imageUrl: string;
    parentId: string;
    name: string;
    isShow: boolean;
    createTime: string;
  }
}
// 线上餐厅
export namespace Online {
  export interface ResAdvertList {
    id: number | string;
    name: string;
    status: boolean;
    imageUrl: string;
    link: string;
  }
}

// 用户管理模块
export namespace User {
  export interface UserInfo {
    avatar: string;
    nickName: string;
    sex: number;
    phone: string;
    introduction: string;
    idCard: string;
    trueName: string;
  }
  export interface userPassWord {
    oldPassword: string;
    password: string;
    repassed: string;
  }
  export interface ReqUserParams extends ReqPage {
    username: string;
    gender: number;
    idCard: string;
    email: string;
    address: string;
    createTime: string[];
    status: number;
  }
  export interface ResUserList {
    id: string;
    username: string;
    gender: number;
    user: { detail: { age: number } };
    idCard: string;
    email: string;
    address: string;
    createTime: string;
    status: number;
    avatar: string;
    photo: any[];
    children?: ResUserList[];
  }
  export interface ResStatus {
    userLabel: string;
    userValue: number;
  }
  export interface ResGender {
    genderLabel: string;
    genderValue: number;
  }
  export interface ResDepartment {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
  export interface ResRole {
    id: string;
    name: string;
    children?: ResDepartment[];
  }
}

// 会员管理模块
export namespace Member {
  export interface MemberInfo {
    avatar: string;
    nickName: string;
    sex: number;
    phone: string;
    introduction: string;
    idCard: string;
    trueName: string;
  }
  export interface ResMemberList {
    id: number;
    avatarImage: string;
    nickName: string;
    mobile: string;
    grade: number;
    gradeName: string;
    sex: number;
    balance: number;
    status: string;
    userName: string;
    birthday: string;
    starDate: string;
    endDate: string;
    number: string;
    giftAmount: number;
    currentBalance: number;
    memo: string;
  }
  export interface ResMemberGradeList {
    id: number;
    title: string;
    isDefault: boolean;
    isOpenUpgrade: boolean;
    rechargeAmount: number;
    name: string;
    expenditureMoney: number;
    prioritySortId: number;
    discountType: number;
    discountValue: number;
    commTypeId?: number;
    alias?: string;
    customeCode?: string;
  }
  export interface ResUserCategoryList {
    id: string | number;
    depositType: number;
    depositMoney: number;
    giveMoney: number;
    giveIntegral: number;
    upGiveIntegral: number;
    depositRuleStatus: number;
    isAccumulation: number;
    remark: string;
    userCategoryId: number | string;
    depositTypeText: number;
    statusText: string;
  }
  export interface ResUserDepositRulesList {
    id: string | number;
    name: string;
  }
}

// 餐厅管理
export namespace Restaurant {
  export interface ResFoodDeskList {
    typeId: number;
    name: string;
    manQty: number;
    useQty: number;
  }
  export interface ResFoodDeskCategoryList {
    number: number;
    name: string;
  }
  export interface ResFoodDeskFeeList {
    id: string;
    deskCount: number;
    name: string;
    deskIds: string[];
    feeType: number;
    rule: string;
    ruleType: string;
    status: boolean;
    unit: number;
  }
}

// 优惠券
export namespace Coupon {
  export interface ResFoodCouponList {
    id: string | number;
    name?: string;
    typeId: number;
    parValue: number;
    isSelected?: boolean;
  }
  export interface ResDiscountRulesList {
    id: string | number;
    programmeName?: string;
    statusText: string;
    programmeCode: string;
    discountUserType: number;
    weekValueList: number[];
    validityObject: string[];
    appointType: number;
    discountType: number;
    isAllUseStore: number;
    status: number;
  }
  export interface ResFoodCouponUserList {
    id: string | number;
    userId: string | number;
    couponCode: string;
    userWxId: string | number;
    couponId: number | string;
    createTime: string;
    status: number;
    remark: string;
    createUserId: number | string;
    useTime: string;
    password: string;
    distributionDate: string;
    collectionTime: string;
    collectionStartDate: string;
    collectionEndDate: string;
    couponName: string;
  }
}

// 菜品管理模块
export namespace Goods {
  export interface ResGoodsCategoryList {
    id: string | number;
    name?: string;
    storeId?: number;
    parentId?: number;
    foodSpecId?: string | number;
    appletShow?: number;
    byName?: string;
    helpCode?: string;
    departId?: number;
    upIcon?: string;
    icon?: string;
    isDelete?: number;
    createTime?: string;
    updateTime?: string;
    foodCount?: number;
    storeName?: string;
    sort?: number;
    url?: string;
    linkType: number;
  }
  export interface GroupList {
    id: string;
    corpId: number;
    storeId: number;
    name: string;
    type: number;
    isDelete: boolean;
    modifyTime: number;
    createTime: string;
    desc: string;
    foodIds: any[];
    foodspecIds: any[];
    detailList: any[];
    count: number;
  }
  export interface ResGoodsList {
    id?: number | string;
    name?: string;
    categoryId?: number;
    ctegoryName?: string;
    price?: number;
    imgUrl?: string;
    unitId?: number;
    unitName?: string;
    goodsStatus?: number;
    foodSpecId: number;
    foodName?: string;
  }
  export interface ResGoodsSpecificationsList {
    id: number;
    name: string;
    refGoodsCount: number;
  }
  export interface ParentFoodcategoryList {
    id?: number;
    name?: string;
  }
  export interface ParentFoodtaskCategory {
    id?: number;
    corpId?: number;
    storeId?: number;
    name?: string;
    isDelete?: number;
    createTime?: string;
    updateTime?: string;
  }
  export interface ParentFoodtaskList {
    id?: number;
    corpId?: number;
    storeId?: number;
    taskTypeId?: number;
    name?: string;
    addPriceWay?: number;
    price: number;
    isDelete?: number;
    FCurrencyFlag?: number;
    createTime?: string;
    updateTime?: string;
  }
  export interface ParentFoodFeedCategory {
    id?: number;
    corpId?: number;
    storeId?: number;
    name?: string;
    isDelete?: number;
    createTime?: string;
    updateTime?: string;
  }
  export interface ParentFoodFeedList {
    orderId: number;
    orderNo: string;
    corpId: number;
    storeId: number;
    planType: number;
    status: number;
    sysUserId: number;
    checkerId: number;
    checkFlag: boolean;
    checkTime: string;
    updateTime: string;
    createTime: string;
    remark: string;
    inventoryplandetailList: any[];
  }
  export interface ResFoodTagLst {
    id: string | number;
    type: number;
    content?: string;
  }
}

// 店务管理
export namespace Operation {
  export interface ResDepartmentList {
    id: number;
    storeId: number;
    status: number;
    name: string;
    number: string;
    createTime: string;
    updateBy: string;
    updateTime: string;
    remark: string;
    role: string;
    roleIds: number[];
  }
  export interface ResOrganizationList {
    type?: number;
    id: number;
    corpId: number;
    storeId: number;
    parentId: number;
    organizationName: string;
    number: string;
    organizationType: number;
    mobile: string;
    manager: string;
    comments: string;
    deleted: number;
  }
  export interface ResStoreList {
    id?: number | string;
    mainStore: number;
    corpId: number;
    splitId: number;
    splitGroupId: number;
    storeName: string;
    mobile: string;
    linkMan: string;
    comments: string;
    logoImage: string;
    earnestAmount: number;
    earnestBalance: number;
    areaId: number;
    cityId: number;
    provinceId: number;
    address: string;
    coordinate: string;
    latitude: string;
    longitude: string;
    isDefault: number;
    distance: string;
    openingTime: string;
    closingTime: string;
    sharingCode: string;
  }
  export interface ResStaffList {
    id: string | number;
    name: string;
    mobile: string;
    sex: number;
    birthday: string;
    nickName: string;
  }
  export interface ResStoreGroupList {
    id: string | number;
    number: string;
    name: string;
    balance: number;
    mobile: string;
    linkMan: string;
  }
  export interface ResGroupStoreList {
    id: string | number;
    storeName: string;
    mobile: string;
    smsSign: string;
    smsSignApplyTime: string;
    facCode: string;
    defaultPassWord: string;
    parentStoreId: string;
    parentStoreName: string;
    linkMan: string;
    address: string;
    state: number;
  }
}

// 库存管理
export namespace Inventory {
  export interface ResCustomList {
    id: number | string;
    customeCode: string;
    name: string;
    alias: string;
    contact: string;
    mobile: string;
    address: string;
    status: number;
    commTypeId: number;
  }
  export interface ResWaresCategoryList {
    id: string | number;
    name: string;
    typeId: string | number;
    imageUrl: string;
  }
  export interface ResWaresBrandList {
    id: string | number;
    name: string;
    logoImageUrl: string | number;
    isShow: number;
  }
  export interface ResWaresList {
    id: string | number;
    name: string;
    bn: string;
    brief: string;
    image: string;
    images: string[];
    video: string;
    goodsCategoryId: number;
    goodsTypeId: number;
    brandId: number;
    isMarketable: boolean;
    unit: number;
    intro: string;
    desc?: string;
  }
  export interface ResSupplierList {
    id: string | number;
    name: string;
    supplierCode: string;
    helpCode: string;
    businessType: number;
    businessTypeName: string;
    commissionRate: number;
    regionId: number;
    regionName: string;
    settleType: number;
    settleTypeName: string;
    checkOutCycle: number;
    monCheckCyclse: string;
    contact: string;
    mobile: string;
    contactAddress: string;
    bank: string;
    bankAccount: string;
    businessLicense: string;
    taxCode: string;
  }
  // 计划数据列表
  export interface ResStockPlanList {
    id: string | number;
    name: string;
    supplierCode: string;
    helpCode: string;
    businessType: number;
    businessTypeName: string;
    commissionRate: number;
    regionId: number;
    regionName: string;
    settleType: number;
    settleTypeName: string;
    checkOutCycle: number;
    monCheckCyclse: string;
    contact: string;
    mobile: string;
    contactAddress: string;
    bank: string;
    bankAccount: string;
    businessLicense: string;
    taxCode: string;
  }
  export interface ResStockRealSheetList {
    orderId: number;
    corpId: number;
    storeId: number;
    orderNo: string;
    range: number;
    planOrderId: number;
    checkerId: number;
    checkFlag: boolean;
    checkTime: string;
    createTime: string;
    updateTime: string;
    remark: "lsh66666";
    sysUserId: number;
    dateType: number;
    inventorydetailList: any;
  }
  // 损益单列表
  export interface ResStockIncomeList {
    orderId: number;
    corpId: number;
    storeId: number;
    orderNo: string;
    range: number;
    planOrderId: number;
    checkerId: number;
    checkFlag: boolean;
    checkTime: string;
    createTime: string;
    updateTime: string;
    remark: "lsh66666";
    sysUserId: number;
    dateType: number;
    inventorydetailList: any;
  }
  export interface ResStockStatementList {
    // 库存流水
    id: number;
    storeId: number;
    corpId: number;
    productId: number;
    goodsId: number;
    price: number;
    balancePrice: number;
    amount: number;
    balanceAmount: number;
    quantity: number;
    balanceQuantity: number;
    convert?: unknown;
    sourceId?: unknown;
    sourceNo?: unknown;
    sourceDetailId?: unknown;
    houseId: number;
    type: number;
    createTime: string;
    barcode: string;
    goodsName?: unknown;
    unitName: string;
    productName: string;
    typeName: string;
    houseName: string;
    categoryName: string;
  }
  export interface ResSupplierRegionList {
    id: number | string;
    name: string;
    areaCode: string;
    totalSupplier: number;
  }
  export interface ResPurchaseList {
    id: number | string;
    orderNo: string;
    orderDate: string;
    supplierId: number;
    deliveryDate: string;
    deliveryStatus: number;
    remark: string;
    checkFlag: number;
    orderAmount: number;
    supplierName: string;
  }
  export interface ResStockOutList {
    id: number | string;
    trackingNo: string;
    LogisticsId: string;
    orderNo: string;
    customerId: string;
    contacts: string;
    mobile: string;
    address: string;
    checkFlag: boolean;
    outTime: string;
    createTime: string;
    LogisticsName: string;
    orderAmount: number;
  }
  export interface ResGoodTotalList {
    id: string | number;
    goodsName: string;
    categoryName: string;
    unitName: string;
    bn: string;
    minQuantity: number;
    maxQuantity: number;
    price: number;
    quantity: number;
  }
  export interface ResStorehouseList {
    id: string | number;
    name: string;
    code: string;
    isDefault: boolean;
  }
  export interface StockCheckoutList {
    id: string | number;
    orderNo: string;
    houseName: string;
    date: string;
    barcode: string;
    goodsName: string;
    categoryName: string;
    unitName: string;
    quantity: number;
    amount: number;
    orderId: number;
    documentType: number;
  }
}

// 系统设置
export namespace System {
  export interface ResDictList {
    value: string;
    label: string;
  }
  export interface ResUserList {
    id: string | number;
    userName: string;
    phone: string;
    nickName: string;
    userType: number;
    avatar: string;
    sex: number;
    email: string;
    trueName: string;
    birthday: string;
    introduction: string;
    state: number;
  }
  export interface ResRoleList {
    id: string | number;
    roleName: string;
    roleCode: string;
    comments: string;
    createTime: number;
    updateTime: string;
  }

  export interface ResLoginRecordList {
    id: string | number;
    username: string;
    os: string;
    device: string;
    browser: string;
    ip: number;
    operType: number;
    createTime: string;
    updateTime: string;
  }

  export interface ResNLogRecordsList {
    id: string | number;
    logDate: string;
    logLevel: string;
    logTitle: string;
    logType: number;
    message: string;
    machineName: string;
    machineIp: string;
  }
  export interface ResTaskLogList {
    id: string | number;
    name: string;
    createTime: string;
    isSuccess: boolean;
    parameters: string;
  }
  export interface ResUserOperationLogList {
    id: string | number;
    name: string;
    createTime: string;
    isSuccess: boolean;
    parameters: string;
  }
  export interface DesignPageList {
    id: string | number;
    name: string;
    createTime: string;
    isSuccess: boolean;
    parameters: string;
  }
  export interface MessageStore {
    checkTime: string;
    facCode: string;
    smsCheckFlag: number;
    smsCount: number;
    smsSign: string;
    smsSignApplyTime: string;
    storeId: number;
  }
  export interface RechargeList {
    count: number;
    gift: number;
    money: number;
  }
  export interface RechargeData {
    list: RechargeList[];
    detail: MessageStore;
  }
}
export namespace Activity {
  // 活动列表
  export interface ResActivityCouponList {
    id: string | number;
    name?: string;
    typeId: number;
    parValue: number;
  }
  export interface ActivityMemberList {
    id?: number;
    templateCode: string;
    content: string;
    type?: string;
    sendTime: string;
    status?: number;
    userIds?: number[];
    createTime: string;
    variables?: any;
    storeId: number;
    statusName: string;
    userCount?: number;
    operation: string;
  }
}

export namespace Reporting {
  interface TrendItem {
    name: string;
    value: number;
    increaseConsumeMember: number;
    increaseConsumeMoney: number;
    increaseTotal: number;
  }
  export interface MemberAnalysis {
    increaseCount?: number;
    count?: number;
    consumeMember?: number;
    consumeTotal?: number;
    trend?: TrendItem[];
  }

  interface ConsumeSummaryItem {
    name: string;
    amount: string | number;
  }

  interface IncomeSummaryItem {
    name: string;
    count: number;
    amount: number;
  }

  interface UserSummaryItem {
    name: string;
    amount: number;
  }

  interface SummaryList {
    comsumeSummary: ConsumeSummaryItem[];
    bigCategorySummary: any[];
    smallCategorySummary: any[];
    incomeSummary: IncomeSummaryItem[];
    userSummary: UserSummaryItem[];
    paymentList: any[];
  }

  export interface BusinessDaySummary {
    list: SummaryList;
  }

  export interface RechargeConsumeData {
    allAmount: number;
    rechargeAllAmount: number;
    rechargeAmount: number;
    giftAmount: number;
    consumeAllAmount: number;
    rechargeConsumeAmount: number;
    giftConsumeAmount: number;
    trend: TrendDay[];
  }
  export interface EmployeePerformanceList {
    foodSpecId: number;
    foodName: string;
    specName: string;
    foodCategoryId: number;
    foodCategoryName: string;
    avgPrice: number;
    realPrice: any;
    quantity: number;
    amount: number;
    discount: number;
    discountAmount: number;
    realAmount: number;
    taskAmount: number;
    feedAmount: number;
    reduceAmount: number;
    allAmount: number;
    billerName: string;
    billerId: number;
    giftAmount: number;
    price: number;
    refQuantity: number;
    saleQuantity: number;
    giftQuantity: number;
  }

  interface TrendDay {
    dayIn: number;
    dayConsume: number;
    name: string;
  }
}

export declare type UserBalanceTotal = {
  count: number;
  balance: number;
  giftBalance: number;
  recharegeBalance: number;
};

export declare type EChartLineOption = {
  title: string;
  xArray: any[];
  yArray: any[];
};

export declare type EChartPieOption = {
  title: string;
  data: any[];
};

export declare type EChartColumnOption = {
  title: string;
  xArray: any[];
  yArray: any[];
};

export declare type BusinessOverview = {
  preWeekDay: string;
  sumAllAmount: number;
  compareSumAllAmount: number;
  sumAmount: number;
  compareSumAmount: number;
  discountAmount: number;
  compareDiscount: number;
  orderCount: number;
  compareOrderCount: number;
  consumeIndex: {
    title: string;
    value: number | string;
    compareValue: string;
  }[];
  marketList: {
    name: string;
    orderCount: number;
    total: number;
    sumAmount: number;
  }[];
  trendChar: {
    amount: number;
    day: string;
    hour: number;
  }[];
  averageConsume: number;
};

export declare type LiTableOption = {
  data: any[];
  maxHeight: number;
  columns: { prop: string; label: string; sortable?: boolean; minWidth?: number }[];
  fixed?: boolean;
};

interface TChart {
  title: string;
  type: "line" | "column";
  categories: string[];
  series: {
    name: string;
    type: "column" | "line";
    data: (number | string)[];
  }[];
}

export declare type TradeAnalysis = {
  cd: {
    type: 1 | 2;
    list: {
      text: string;
      value: number | string;
    }[];
  }[];
  personTrend: TChart;
  perAvgComsumeTrend: TChart;
  avgComsumeTrend: TChart;
  ktTrend: TChart;
  ftTrend: TChart;
  szTrend: TChart;
};

export namespace Takeout {
  export interface TakeoutRelevancy {
    sourceFoodId: Number;
    sourceSpecId: number;
    sourceFoodName: string;
    sourceCategoryName: string;
    sourcePrice: number;
    status: number;
    statusName: string;
    foodName: string;
    foodId: number;
    specId: number;
    sourceType: number;
    TakeoutRelevancy: string;
  }
  export interface TakeoutOrderList {
    orderId: number;
    orderNo: string;
    daySeq: number;
    ctime: number;
    orderDate: string;
    recipientName: string;
    recipientPhone: any;
    deliveryTime: number;
    deliveryTimeStr: string;
    sumAllAmount: number;
    status: number;
    statusName: string;
    caution: string;
    utime: number;
    utimeStr: number;
    reason: any;
    foodId: number | string | undefined;
    specId: number;
    bindingStatus?: number;
  }
  export interface TakeoutList {
    bingdingFoodName: string;
    bingdingStatus: 1;
    bingdingStatusName: string;
    categoryName: string;
    foodName: string;
    isRelated: boolean;
    mt_sku_id: number;
    price: number;
    relateId: number;
    skuAttr: string;
    skuAttrList: any;
    spec: string;
    stock: string;
    weight_unit: string;
  }
  export interface TakeoutEdit {
    changeStock: boolean;
    classId: number;
    corpId: number;
    couponId: number;
    couponReduceAmount: number;
    deskId: number;
    deskName: string;

    foodData: {
      id: number;
      detailId: number;
      stockId: number;
      orderId: number;
      entryNo: null;
      foodId: number;
      foodSpecId: number;
      convert: number;
      foodImage: string;
      foodName: string;
      price: number;
      quantity: number;
      realAmount: number;
      realPrice: number;
      specName: string;
      amount: number;
      allAmount: number;
      costPrice: number;
    }[];
    foodNameImages: string;
    grantId: number;
    isUpload: boolean;
    modifyTime: number;
    number: string;
    orderDate: string;
    orderId: number;
    orderIdStr: string;
    orderNo: string;
    ordertype: number;
    payStatus: number;
    paymentCode: number;
    paymentName: string;
    promotionId: number;
    promotionType: number;
    remark: string;
    shipId: number;
    sourceType: number;
    splitId: number;
    stateName: string;
    status: number;
    storeId: number;
    storeName: string;
    subOrderId: number;
    sumAllAmount: number;
    sumAllAmount1: number;
    sumAmount: number;
    sumDiscountAmount: number;
    sumFeedAmount: number;
    sumQuantity: number;
    sumRealAmount: number;
    sumReduceAmount: number;
    sumTaskAmount: number;
    sysUserId: number;
    takeOutStatus: number;
    telephone: string;
    userId: number;
    userWxId: number;
  }
}
export namespace qrcode {
  export interface qrcodeInfo {
    code: number;
    count: number;
    data: string;
    otherData: any;
    rowId: any;
  }
}
